
export default {
  data() {
    return {
      fieldList: [
        { name: '标题', field: 'field1' },
        { name: '供应商编号', field: 'field2' },
        { name: '供应商全称', field: 'field3' },
        { name: '供应商简称', field: 'field4' },
        { name: '开户行', field: 'field5' },
      ],

      supplierStatusOption: [
        { label: '合格', value: '1' },
        { label: '不合格', value: '2' },
      ],

      approveStatusOption: [
        { label: '待申请', value: '1' },
        { label: '审批中', value: '2' },
        { label: '已审批', value: '3' },
        { label: '已驳回', value: '4' }
      ],
      approveStatusEnum: {
        '1': '待申请',
        '2': '审批中',
        '3': '已审批',
        '4': '已驳回',
      },

      basicColumns: {
        index: { title: '序号', width: 50, customRender: (text, record, index) => `${index + 1}`, align: 'center' },
        createTime: { title: '创建时间', dataIndex: 'createTime', width: 120, scopedSlots: { customRender: 'date' }, ellipsis: true },
        supplierStatus: { title: '供应商状态', dataIndex: 'supplierStatus', width: 100, scopedSlots: { customRender: 'supplierStatus' }, ellipsis: true },
        frozenStatus: { title: '冻结申请审批状态', dataIndex: 'frozenStatus', width: 150, scopedSlots: { customRender: 'approveStatus' }, ellipsis: true },
        recoverStatus: { title: '恢复申请审批状态', dataIndex: 'recoverStatus', width: 150, scopedSlots: { customRender: 'approveStatus' }, ellipsis: true },
        outStatus: { title: '淘汰申请审批状态', dataIndex: 'outStatus', width: 150, scopedSlots: { customRender: 'approveStatus' }, ellipsis: true },
        blackListStatus: { title: '黑名单申请审批状态', dataIndex: 'blackListStatus', width: 150, scopedSlots: { customRender: 'approveStatus' }, ellipsis: true },
        supplierLevel: { title: '供应商等级', dataIndex: 'supplierLevel', width: 100, scopedSlots: { customRender: 'supplierLevel' }, ellipsis: true },
        supplierFullName: { title: '供应商全称', dataIndex: 'supplierFullName', width: 220, ellipsis: true },
        supplierShortName: { title: '供应商简称', dataIndex: 'supplierShortName', width: 150, ellipsis: true },
        supplierMainCategory: { title: '供应商主营品类', dataIndex: 'supplierMainCategory', width: 150, ellipsis: true },
        supplierCode: { title: '供应商编号', dataIndex: 'supplierCode', width: 150, ellipsis: true },
        contactArea: { title: '联系地区', dataIndex: 'contactArea', width: 200, ellipsis: true },
        contactAddress: { title: '联系地址', dataIndex: 'contactAddress', width: 200, ellipsis: true },
        depositBank: { title: '开户行', dataIndex: 'depositBank', width: 200, ellipsis: true },
        receivablesAccount: { title: '收款账号', dataIndex: 'receivablesAccount', width: 220, ellipsis: true },
        receivablesPerson: { title: '收款人', dataIndex: 'receivablesPerson', width: 100, ellipsis: true },
        legalRepresentative: { title: '法定代表人', dataIndex: 'legalRepresentative', width: 100, ellipsis: true },
        uscCode: { title: '统一信用代码', dataIndex: 'uscCode', width: 200, ellipsis: true },
        enterpriseQueryResult: { title: '企业查询结果', dataIndex: 'enterpriseQueryResult', width: 300, ellipsis: true },
        inquiryChannel: { title: '查询渠道', dataIndex: 'inquiryChannel', width: 150, ellipsis: true },
      },
    }
  },
  computed: {
    effectColumns() {
      const bc = this.basicColumns;
      return [
        bc.index,
        bc.createTime,
        bc.supplierStatus,
        bc.frozenStatus,
        bc.supplierLevel,
        bc.supplierFullName,
        bc.supplierShortName,
        bc.supplierMainCategory,
        bc.supplierCode,
        bc.contactArea,
        bc.contactAddress,
        bc.depositBank,
        bc.receivablesAccount,
        bc.receivablesPerson,
        bc.legalRepresentative,
        bc.uscCode,
        bc.enterpriseQueryResult,
        bc.inquiryChannel,
        { title: '操作', dataIndex: 'action', width: 150, align: 'center', fixed: 'right', scopedSlots: { customRender: 'action' } }
      ]
    },
    frozenColumns() {
      const bc = this.basicColumns;
      return [
        bc.index,
        bc.createTime,
        bc.supplierStatus,
        bc.recoverStatus,
        bc.outStatus,
        bc.supplierLevel,
        bc.supplierFullName,
        bc.supplierShortName,
        bc.supplierMainCategory,
        bc.supplierCode,
        bc.contactArea,
        bc.contactAddress,
        bc.depositBank,
        bc.receivablesAccount,
        bc.receivablesPerson,
        bc.legalRepresentative,
        bc.uscCode,
        bc.enterpriseQueryResult,
        bc.inquiryChannel,
        { title: '操作', dataIndex: 'action', width: 200, align: 'center', fixed: 'right', scopedSlots: { customRender: 'action' } }
      ]
    },
    outColumns() {
      const bc = this.basicColumns;
      return [
        bc.index,
        bc.createTime,
        bc.supplierStatus,
        bc.blackListStatus,
        bc.supplierLevel,
        bc.supplierFullName,
        bc.supplierShortName,
        bc.supplierMainCategory,
        bc.supplierCode,
        bc.contactArea,
        bc.contactAddress,
        bc.depositBank,
        bc.receivablesAccount,
        bc.receivablesPerson,
        bc.legalRepresentative,
        bc.uscCode,
        bc.enterpriseQueryResult,
        bc.inquiryChannel,
        { title: '操作', dataIndex: 'action', width: 150, align: 'center', fixed: 'right', scopedSlots: { customRender: 'action' } }
      ];
    },
    blackListColumns() {
      const bc = this.basicColumns;
      return [
        bc.index,
        bc.createTime,
        bc.supplierStatus,
        bc.supplierLevel,
        bc.supplierFullName,
        bc.supplierShortName,
        bc.supplierMainCategory,
        bc.supplierCode,
        bc.contactArea,
        bc.contactAddress,
        bc.depositBank,
        bc.receivablesAccount,
        bc.receivablesPerson,
        bc.legalRepresentative,
        bc.uscCode,
        bc.enterpriseQueryResult,
        bc.inquiryChannel,
        { title: '操作', dataIndex: 'action', width: 100, align: 'center', fixed: 'right', scopedSlots: { customRender: 'action' } }
      ];
    },
    columns() {
      const columnEnum = {
        '1': this.effectColumns,
        '2': this.frozenColumns,
        '3': this.outColumns,
        '4': this.blackListColumns,
      }
      return columnEnum[this.curTabValue];
    }
  }
}